package com.gy.ai.agent.platform.siliconflow.entity;

import com.gy.ai.agent.core.ReqOptions;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author LGY
 * Create by 2025/6/17 8:30
 */
@Data
@Accessors(chain = true)
public class SiliconflowChatReq extends ReqOptions implements Serializable {

    private String model;

    private List<Message> messages;

    private Boolean stream;

    private Integer max_tokens;

    private Boolean enable_thinking;

    private Integer thinking_budget;

    private BigDecimal min_p;

    private Boolean stop;

    private BigDecimal temperature;

    private BigDecimal top_p;

    private Integer top_k;

    private BigDecimal frequency_penalty;

    private Integer n;

    private ResponseFormat response_format;

    private List<Tool> tools;

    @Data
    @Accessors(chain = true)
    public static class Tool implements Serializable {

        private String type;

        private Function function;
    }

    @Data
    @Accessors(chain = true)
    public static class Function implements Serializable {

        private String name;

        private String description;

        private List<Parameter> parameters;

        private Boolean strict;
    }

    @Data
    @Accessors(chain = true)
    public static class Parameter implements Serializable {

        private String _comments;
    }


    @Data
    @Accessors(chain = true)
    public static class ResponseFormat implements Serializable {

        private String type;
    }

    @Data
    @Accessors(chain = true)
    public static class Message implements Serializable {

        /**
         * user, assistant, system
         */
        private String role;

        /**
         * 消息内容
         */
        private String content;
    }
}
